BenSelect Documentation
Rounding salary in JScript on plan
Send Feedback
JScript Examples > JScript for Plans > Rounding salary in JScript on plan

Glossary Item Box

If a salary needs to be rounded prior to calculation, put this in the OnLoad of the plan:
 

var originalSalary = Event.Employee.Salary;

var newSalary = 0;

var RoundToNearest = 100; // set this to the value you want to round to, nearest 100 in this case

newSalary = Math.round(originalSalary / RoundToNearest) * RoundToNearest;

Event.Employee.Salary = newSalary;

©2024. All Rights Reserved.